﻿using System;
using System.Collections.Generic;

namespace DanMuHelper.Tools
{
    public interface IState<T> where T : Enum
    {
        /// <summary>
        /// 获得对应状态类的Id
        /// </summary>
        T Id { get; }

        /// <summary>
        /// 状态进入前，调用此函数
        /// </summary>
        void OnEnterState();

        /// <summary>
        /// 状态时，调用此函数
        /// </summary>
        void OnUpdateState(float deltaTime);

        /// <summary>
        /// 状态退出前，调用此函数
        /// </summary>
        void OnExitState();

        /// <summary>
        /// 状态转换函数，通过此函数判断是否转移状态
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        bool TransitionState(float deltaTime, out T id);
    }
}